package com.samoilovich.belarustoday.tech.fragments;

import android.content.Context;
import android.view.View;
import android.widget.AdapterView;
import com.samoilovich.belarustoday.R;
import com.samoilovich.belarustoday.basefragments.NewsListBaseFragment;
import com.samoilovich.belarustoday.datemodel.CategoryModel;
import com.samoilovich.belarustoday.handlers.NewsHandler;
import com.samoilovich.belarustoday.tech.TechActivity;

public class TechCategoryFragment extends NewsListBaseFragment {
    public TechCategoryFragment() {
    }

    public TechCategoryFragment(Context context, CategoryModel categoryModel) {
        mCurrentCategory = categoryModel;
        sNews = null;
        mOnItemClickListener = new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
                long newsId = mAdapter.getItem(position).getId();
                ((TechActivity) getActivity()).setTechCategoryContentFragment(newsId, mCurrentCategory.getName());
            }
        };
        mBackLabel = R.string.technologies_label;
        getNews(context);
    }
}
